<?php

require_once ('library/Zend/View/Helper/Abstract.php');

class Zend_View_Helper_CharacterTag extends Zend_View_Helper_Abstract {
    public function CharacterTag($tags,$checkedTags,$level){
        
        $str="";
		foreach ($tags as $tag){
		    if(is_array($checkedTags)){
    		    if(in_array($tag['name'], $checkedTags)){
    		        $str.="<input type='checkbox' name='level".$level."[]' checked='checked' value='".$tag['name']."'/>".$tag['name'];
    		    }else{
    		        $str.="<input type='checkbox' name='level".$level."[]' value='".$tag['name']."'/>".$tag['name'];
    		    }
		    }else{
		        $str.="<input type='checkbox' name='level".$level."[]' value='".$tag['name']."'/>".$tag['name'];
		    }
		}
		return $str;
	}
}

?>